package com.hello.system.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.hello.common.core.annotation.Excel;
import com.hello.common.core.web.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 用户积分变动日志对象 user_points_log
 * 
 * @author hello
 * @date 2025-10-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class UserPointsLog extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 日志ID（主键） */
    private Long id;

    /** 用户ID（关联users表） */
    @Excel(name = "用户ID", readConverterExp = "关=联users表")
    private Long userid;

    /** 积分变动值（正数为增加，负数为减少） */
    @Excel(name = "积分变动值", readConverterExp = "正=数为增加，负数为减少")
    private Long pointsChange;

    /** 变动前积分余额 */
    @Excel(name = "变动前积分余额")
    private Long pointsBefore;

    /** 变动后积分余额 */
    @Excel(name = "变动后积分余额")
    private Long pointsAfter;

    /** 变动类型（1-签到，2-消费，3-充值，4-活动奖励，5-系统赠送，6-退款，7-管理员调整，8-其他） */
    @Excel(name = "变动类型", readConverterExp = "1=-签到，2-消费，3-充值，4-活动奖励，5-系统赠送，6-退款，7-管理员调整，8-其他")
    private Integer changeType;

    /** 变动原因说明 */
    @Excel(name = "变动原因说明")
    private String changeReason;

    /** 关联业务ID（如订单号、活动ID等） */
    @Excel(name = "关联业务ID", readConverterExp = "如=订单号、活动ID等")
    private String relatedId;

    /** 操作员（管理员调整时记录操作人） */
    @Excel(name = "操作员", readConverterExp = "管=理员调整时记录操作人")
    private String operator;

    /** 记录状态（有效-正常生效，无效-失效，已撤销-已撤销） */
    @Excel(name = "记录状态", readConverterExp = "有=效-正常生效，无效-失效，已撤销-已撤销")
    private String status;

    /** 额外扩展数据（JSON格式） */
    @Excel(name = "额外扩展数据", readConverterExp = "J=SON格式")
    private String extraData;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setUserid(Long userid) 
    {
        this.userid = userid;
    }

    public Long getUserid() 
    {
        return userid;
    }
    public void setPointsChange(Long pointsChange) 
    {
        this.pointsChange = pointsChange;
    }

    public Long getPointsChange() 
    {
        return pointsChange;
    }
    public void setPointsBefore(Long pointsBefore) 
    {
        this.pointsBefore = pointsBefore;
    }

    public Long getPointsBefore() 
    {
        return pointsBefore;
    }
    public void setPointsAfter(Long pointsAfter) 
    {
        this.pointsAfter = pointsAfter;
    }

    public Long getPointsAfter() 
    {
        return pointsAfter;
    }
    public void setChangeType(Integer changeType) 
    {
        this.changeType = changeType;
    }

    public Integer getChangeType() 
    {
        return changeType;
    }
    public void setChangeReason(String changeReason) 
    {
        this.changeReason = changeReason;
    }

    public String getChangeReason() 
    {
        return changeReason;
    }
    public void setRelatedId(String relatedId) 
    {
        this.relatedId = relatedId;
    }

    public String getRelatedId() 
    {
        return relatedId;
    }
    public void setOperator(String operator) 
    {
        this.operator = operator;
    }

    public String getOperator() 
    {
        return operator;
    }
    public void setStatus(String status) 
    {
        this.status = status;
    }

    public String getStatus() 
    {
        return status;
    }
    public void setExtraData(String extraData) 
    {
        this.extraData = extraData;
    }

    public String getExtraData() 
    {
        return extraData;
    }
    public void setCreatedAt(Date createdAt) 
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() 
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt) 
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() 
    {
        return updatedAt;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userid", getUserid())
            .append("pointsChange", getPointsChange())
            .append("pointsBefore", getPointsBefore())
            .append("pointsAfter", getPointsAfter())
            .append("changeType", getChangeType())
            .append("changeReason", getChangeReason())
            .append("relatedId", getRelatedId())
            .append("operator", getOperator())
            .append("remark", getRemark())
            .append("status", getStatus())
            .append("extraData", getExtraData())
            .append("createdAt", getCreatedAt())
            .append("updatedAt", getUpdatedAt())
            .toString();
    }
}
